package com.sumainfor.pc.market.controller.servicemanger;

import com.qiniu.util.Json;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.PageUtils;
import com.sumainfor.common.utlis.Pager;
import com.sumainfor.pc.market.service.SeHousingService;
import com.sumainfor.pc.market.service.SePactService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 服务中心经理审核房源合同
 */
@RestController
@RequestMapping("/servicemanger/SePact")
public class SePactController implements Serializable {
    @Autowired
    private SePactService sePactService;
    /**
     *分页查询待审核的合同列表
     * @param
     * @return
     */
    @PostMapping("/getSePactList")
    public JsonResult getSePactList(@RequestBody Map<String,Object>params, Pager pager){
        JsonResult result=new JsonResult();
        pager.setPageno(Integer.parseInt(params.get("pageno").toString()));
        pager.setPagesize(Integer.parseInt(params.get("pagesize").toString()));
        pager.setPagerNecessary(params, pager);
        PageUtils pageUtils = new PageUtils();
        Integer cout=sePactService.getSePactListCount(params);
        if(cout==0){
            return pageUtils.getJsonResult(new ArrayList<Map<String,Object>>(), params,cout);
        }
        List<Map<String,Object>>getCommunityList=sePactService.getSePactList(params);
        result=pageUtils.getJsonResult(getCommunityList, params, cout);
        return result;
    }
    /**
     *服务中心租赁顾问管理二级页面查询本月签单客户
     * @param
     * @return
     */
    @GetMapping("/getSePactTenList")
    public JsonResult getSePactTenList(@RequestParam Map<String,Object>params){
        return sePactService.getSePactTenList(params);
    }
    /**
     * 查询内部房源在第三方房源信息
     */
    @GetMapping("/getSePactThird")
    public JsonResult getSePactThird(@RequestParam Map<String,Object>params){
        return sePactService.getSePactThird(params);
    }

}
